package com.hbx.residential_service.domain;

import com.hbx.residential_service.utils.DateUtils;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class Pay {
    private int payId;
    private Integer payType;
    private String payTypeStr;
    private double payMoney;
    private Integer payStatus;
    private String payStatusStr;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date payDate;
    private String payDateStr;
    private User user;

    public int getPayId() {
        return payId;
    }

    public void setPayId(int payId) {
        this.payId = payId;
    }

    public Integer getPayType() {
        return payType;
    }

    public void setPayType(Integer payType) {
        this.payType = payType;
    }

    public String getPayTypeStr() {
        if(payType!=null){
            if(payType==0)payTypeStr="水费";
            if(payType==1)payTypeStr="电费";
            if(payType==2)payTypeStr="物业费";
        }
        return payTypeStr;
    }

    public void setPayTypeStr(String payTypeStr) {
        this.payTypeStr = payTypeStr;
    }

    public double getPayMoney() {
        return payMoney;
    }

    public void setPayMoney(double payMoney) {
        this.payMoney = payMoney;
    }

    public Integer getPayStatus() {
        return payStatus;
    }

    public void setPayStatus(Integer payStatus) {
        this.payStatus = payStatus;
    }

    public String getPayStatusStr() {
        if(payStatus!=null){
            if(payStatus==0)payStatusStr="未缴费";
            if(payStatus==1)payStatusStr="已缴费";
        }
        return payStatusStr;
    }

    public void setPayStatusStr(String payStatusStr) {
        this.payStatusStr = payStatusStr;
    }

    public Date getPayDate() {
        return payDate;
    }

    public void setPayDate(Date payDate) {
        this.payDate = payDate;
    }

    public String getPayDateStr() {
        if(payDate!=null){
            payDateStr= DateUtils.DateToString(payDate,"yyyy-MM-dd");
        }
        return payDateStr;
    }

    public void setPayDateStr(String payDateStr) {
        this.payDateStr = payDateStr;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }
}
